home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 December: Technology Seed / ADC Seed CD - Dec'98.toast / FireWire / FireWire 1.3 SDK DR1 / Source / SBP2 / SBP2DemoApp / SBP2DemoApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-21  |  4.0 KB  |  165 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SBP2DemoApp.h
  3.  
  4.     Contains:    Definitions for SBP-2 demo application.
  5.  
  6.     Version:    1.0
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Eric Anderson
  13.  
  14.         Other Contact:        
  15.  
  16.         Technology:            FireWire
  17.  
  18.     Writers:
  19.  
  20.         (EA)    Eric Anderson (ewa)
  21.  
  22.     Change History (most recent first):
  23.  
  24.        <FW2>     9/20/98    EA        Filled in header comments.
  25.        <FW1>     9/20/98    EA        first checked in
  26. */
  27.  
  28.  
  29. #ifndef __SBP2DEMOAPP__
  30. #define __SBP2DEMOAPP__
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if PRAGMA_IMPORT_SUPPORTED
  37. #pragma import on
  38. #endif
  39.  
  40. #if PRAGMA_ALIGN_SUPPORTED
  41. #pragma options align=mac68k
  42. #endif
  43.  
  44. // These are for positioning the dialogs.
  45.  
  46. #define kDITop                    0x0050
  47. #define kDILeft                    0x0070
  48.  
  49. // kExtremeNeg and kExtremePos are used to set up wide open rectangles and
  50. // regions.
  51.  
  52. #define kExtremeNeg                (-32768)
  53. #define kExtremePos                (32767 - 1)                // Required to address an old region bug
  54.  
  55. enum
  56. {
  57.     kInvalidWindowRef            = 0
  58. };
  59.  
  60. enum
  61. {
  62.     kMenuBarResourceID            = 128,
  63.  
  64.     kSBP2DemoWindowResourceID    = 128,
  65.  
  66.     kAboutAlertResourceID        = 128
  67. };
  68.  
  69. enum
  70. {
  71.     kAppleMenuID                = 128,
  72.     kAboutAppleMenuItem            = 1,
  73.  
  74.     kFileMenuID                    = 129,
  75.     kNewFileMenuItem            = 1,
  76.     kCloseFileMenuItem            = 4,
  77.     kQuitFileMenuItem            = 12,
  78.  
  79.     kEditMenuID                    = 130,
  80.     kUndoEditMenuItem            = 1,
  81.     kCutEditMenuItem            = 3,
  82.     kCopyEditMenuItem            = 4,
  83.     kPasteEditMenuItem            = 5,
  84.     kClearEditMenuItem            = 6,
  85.  
  86.     kCommandMenuID                = 131,
  87.     kLoginMenuItem                = 1,
  88.     kLogoutMenuItem                = 2,
  89.     kQueryLoginsMenuItem        = 4,
  90.     kStatusInquiryMenuItem        = 6,
  91.     kModeSenseMenuItem            = 7,
  92.     kReadBlockMenuItem            = 8
  93. };
  94.  
  95. struct SBP2DemoAppDataStruct
  96. {
  97.     QDGlobals                    qdGlobals;                // Quickdraw globals for our application.
  98.  
  99.     struct SBP2DemoDataStruct
  100.                                 *sbp2DemoDataList;        // List of devices.
  101.  
  102.     AEEventHandlerUPP            openApplicationEventHandler;    // Handler for open application events.
  103.     Boolean                        openApplicationEventHandlerInstalled;    // True if handler was successfully installed.
  104.  
  105.     AEEventHandlerUPP            openDocumentsEventHandler;    // Handler for open documents events.
  106.     Boolean                        openDocumentsEventHandlerInstalled;    // True if handler was successfully installed.
  107.  
  108.     AEEventHandlerUPP            printDocumentsEventHandler;    // Handler for print documents events.
  109.     Boolean                        printDocumentsEventHandlerInstalled;    // True if handler was successfully installed.
  110.  
  111.     AEEventHandlerUPP            quitApplicationEventHandler;    // Handler for quit application events.
  112.     Boolean                        quitApplicationEventHandlerInstalled;    // True if handler was successfully installed.
  113.  
  114.     AEEventHandlerUPP            deviceAddedEventHandler;    // Handler for device added events.
  115.     Boolean                        deviceAddedEventHandlerInstalled;    // True if handler was successfully installed.
  116.  
  117.     AEEventHandlerUPP            deviceRemovedEventHandler;    // Handler for device removed events.
  118.     Boolean                        deviceRemovedEventHandlerInstalled;    // True if handler was successfully installed.
  119.  
  120.     SBPClientID                    sbpClientID;            // Our client ID for the sample driver family.
  121.  
  122.     Boolean                        inForeground;            // True if app is in foreground.
  123.     Boolean                        quit;                    // Flag to tell event loop to quit.
  124. };
  125. typedef struct SBP2DemoAppDataStruct
  126.                                 SBP2DemoAppData,
  127.                                 *SBP2DemoAppDataPtr;
  128.  
  129. struct SBP2DemoDataStruct
  130. {
  131.     struct SBP2DemoDataStruct
  132.                                 *pNextSBP2DemoData;    // Link to next data record.
  133.     WindowRef                    sbp2DemoWindowRef;    // Window reference for this device.
  134.     SBPDriverID                    sbpDriverID;        // Reference to driver we control.
  135.     Boolean                        login;                // True if logged in.
  136.     Boolean                        reconnecting;    
  137.     Boolean                        reconnectFailed;    
  138.     UInt32                        lastCommand;
  139.     UInt32                        lastError;
  140.     SBPStatusInquiryParams        sbpStatusInquiryParams;
  141.     SBPModeSenseParams            sbpModeSenseParams;
  142.     SBPReadBlockParams            sbpReadBlockParams;
  143.     UInt32                        notificationCounter;
  144.     UInt32                        notificationEvent;
  145.     UInt32                        notificationLength;
  146.     Ptr                            notificationMessage;
  147. };
  148. typedef struct SBP2DemoDataStruct
  149.                                 SBP2DemoData,
  150.                                 *SBP2DemoDataPtr;
  151.  
  152. #if PRAGMA_ALIGN_SUPPORTED
  153. #pragma options align=reset
  154. #endif
  155.  
  156. #if PRAGMA_IMPORT_SUPPORTED
  157. #pragma import off
  158. #endif
  159.  
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163.  
  164. #endif /* __SBP2DEMOAPP__ */
  165.